#include "my_head.h"

bool Insertnode(p_flight_node head)
{
    if(head==NULL)
    {
        printf("error\n");
        return false;
    }
    p_flight_node newnode=calloc(1,sizeof(flight_node));
    if(newnode==NULL)
    {
        printf("%s %d error\n",__FUNCTION__,__LINE__);
        return false;
    }
    p_flight_node p=head;
    while(p->next!=NULL)
    {
        p=p->next;
    }
    newnode->next=p->next;
    p->next=newnode;
    printf("请添加航班号信息:\n");
    scanf("%s",newnode->data.flight_Number);
    printf("请添加航班机型信息:\n");
    scanf("%s",newnode->data.aircraft_Model);
    printf("请添加航班预计起飞时间信息:\n");
    scanf("%s",newnode->data.departure_Time);
    printf("请添加航班预计降落时间信息:\n");
    scanf("%s",newnode->data.arrival_Time);
    printf("请添加航班班期信息:\n");
    scanf("%s",newnode->data.flight_Schedule);
    printf("请添加航班起飞机场信息:\n");
    scanf("%s",newnode->data.departure_Airport);
    printf("请添加航班目的机场信息:\n");
    scanf("%s",newnode->data.arrival_Airport);
    printf("添加成功！\n");
    printf("=================\n");
    return true;
}